import { useState } from "react";
import Screen from './Screen'
const Computer=()=>{
    const [status,setStatus]=useState(false)
    const toggle=()=>{
        setStatus(!status)
    }
    return (
        <div>
            Computer
            <button onClick={toggle}>{status?'开':'关'}</button>
            {/* 父子组件传值 */}
            <Screen logo="明基" showContent={status?'显示器亮':'显示器关了'}/>
        </div>
    )
}

export default Computer